export default class btnclick extends Laya.Script {
    public scaleTime = 90;
    constructor() {
        super();
    }
    onEnable() {
        this.owner.on(Laya.Event.MOUSE_DOWN, this, this.scaleSmall);
        //添加鼠标抬起事件侦听。抬起时还原按钮。
        this.owner.on(Laya.Event.MOUSE_UP, this, this.scaleBig);
        //添加鼠标离开事件侦听。离开时还原按钮。
        this.owner.on(Laya.Event.MOUSE_OUT, this, this.scaleBig);
    }


    private scaleBig(): void {
        console.log("---big--->")
        //变大还原的缓动效果
        Laya.Tween.to(this.owner, { scaleX: 1, scaleY: 1 }, this.scaleTime,null,null,null,true);
    }
    private scaleSmall(): void {
        //缩小至0.8的缓动效果
        Laya.Tween.to(this.owner, { scaleX: 0.8, scaleY: 0.8 }, this.scaleTime,null,null,null,true);
    }
}